﻿<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title>字典-添加-子级</title>

    <link rel="shortcut icon" href="favicon.ico">
	<link href="css/bootstrap.min.css?v=3.3.5" rel="stylesheet">
	<link href="css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="css/animate.min.css" rel="stylesheet">
    <link href="css/plugins/toastr/toastr.min.css" rel="stylesheet">
    <link href="css/style.min.css?v=4.0.0" rel="stylesheet">
	<style>
		.control-label{
			line-height:35px;
			text-align:center;
		}

		.ibox-content{
			padding:0 0 20px 0;
		}
	</style>
</head>

<body class="gray-bg">
    <div class="wrapper animated fadeInRight">

        <div class="row">
			<div class="ibox-content">
				<form id="argForm" class="form-horizontal m-t">
					<div class="form-group">
						<label class="col-xs-3 control-label">父级名称：</label>
						<div class="col-xs-8">
							<input id="pName" disabled class="form-control" type="text">
							<!--<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 这里写点提示的内容</span>-->
						</div>
					</div>
						<div class="form-group">
						<label class="col-xs-3 control-label">父级代码：</label>
						<div class="col-xs-8">
							<input name="pCode" type="hidden" class="form-control">
							<input id="pCode" disabled class="form-control" type="text">
							<!--<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 这里写点提示的内容</span>-->
						</div>
					</div>
					<div class="form-group">
						<label class="col-xs-3 control-label">字典名：</label>
						<div class="col-xs-8">
							<input id="dictName" name="dictName" class="form-control" type="text">
							<!--<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 这里写点提示的内容</span>-->
						</div>
					</div>
					<div class="form-group">
						<label class="col-xs-3 control-label">代码：</label>
						<div class="col-xs-8">
							<input id="dictCode" name="dictCode" class="form-control" type="text">
							<!--<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 这里写点提示的内容</span>-->
						</div>
					</div>
					<div class="form-group">
						<label class="col-xs-3 control-label">备注：</label>
						<div class="col-xs-8">
							<input id="note" name="note" class="form-control" type="text">
						</div>
					</div>
					<div class="form-group">
						<div class="col-xs-3 col-xs-offset-8">
							<button class="btn btn-primary" onclick="addChildDict();" type="button">提交</button>
						</div>
					</div>
				</form>
			</div>
        </div>
    </div>
    <script src="js/jquery.min.js?v=2.1.4"></script>
    <script src="js/bootstrap.min.js?v=3.3.5"></script>
    <script src="js/content.min.js?v=1.0.0"></script>
	<script src="js/plugins/toastr/toastr.min.js"></script>
    <script src="js/plugins/validate/jquery.validate.min.js"></script>
    <script src="js/plugins/validate/messages_zh.min.js"></script>
    <script src="js/plugins/iCheck/icheck.min.js"></script>
	<script src="js/custom/layTool.js"></script>
    <script type="text/javascript" src="js/custom/app.js" charset="UTF-8"></script>
    <script type="text/javascript" src="js/custom/tools.js" charset="UTF-8"></script>
	<script>
        $(document).ready(function(){$(".i-checks").iCheck({checkboxClass:"icheckbox_square-green",radioClass:"iradio_square-green",})});
    </script>

	<script>
		function addChildDict(){

			//初始用户信息（全局）
			var formData = new FormData($("form#argForm")[0]);
			var url = 'sysDict/addChildDict';
			jQuery.ajax({
				url:domain + url,
				type:"post",
				data:JSON.stringify(formData2JsonStr(formData)),
				contentType:"application/json;charset=utf-8",
				crossDomain:true,
				xhrFields:{
					withCredentials:true
				},
				success:function (data) {
					if(data.status == 200 ){
						var arr = [pCode];
						callFn("searchChildDict",arr);
					}else{
						top.toastr.warning(data.msg);
					}
				},
				error:function(data) {
					top.toastr.error("操作失败，请检查网络");
				}
			})
		}

		$(function(){
			pName = getQueryString("pName");
			pCode = getQueryString("pCode");
			$("#pName").val(pName);
			$("#pCode").val(pCode);
			$("input[name=pCode]").val(pCode);

		})

	</script>

</body>

</html>
